package com.aspose.cells;

class zmy extends zmt {
   private boolean d;
   private String e;
   private com.aspose.cells.b.a.g.a.ze f;

   zmy(zaay var1, zzn var2, String var3, boolean var4) {
      super(var1, var2);
      if ("".equals(var3)) {
         this.d = true;
         this.e = "";
         this.f = null;
      } else {
         this.d = false;
         if (!var4 || !this.b && !this.c) {
            this.e = var3;
            this.f = null;
         } else {
            Object var5 = var1.p.a(var3);
            if (var5 == null) {
               this.e = var3;
               this.f = null;
            } else if (var5 instanceof com.aspose.cells.b.a.g.a.ze) {
               this.e = var3;
               this.f = (com.aspose.cells.b.a.g.a.ze)var5;
            } else {
               this.e = (String)var5;
               this.f = null;
            }
         }
      }

   }

   public int a() {
      return 2;
   }

   public zagu b() {
      return this.d ? zaam.a : new zaam(this.e);
   }

   public boolean a(zagu var1) {
      switch(var1.b()) {
      case 1:
         return this.b(((zyv)var1).k() ? zaam.b : zaam.c);
      case 2:
         return this.b(var1);
      case 12:
         if (this.b) {
            return this.d;
         } else {
            if (this.c) {
               return !this.d;
            }

            return false;
         }
      default:
         return this.c;
      }
   }

   public boolean b(zagu var1) {
      if (this.b) {
         return this.f != null ? this.f.d(((zaam)var1).k()) : com.aspose.cells.a.c.zx.a(this.e, ((zaam)var1).k());
      } else if (this.c) {
         if (this.f != null) {
            return !this.f.d(((zaam)var1).k());
         } else {
            return !com.aspose.cells.a.c.zx.a(this.e, ((zaam)var1).k());
         }
      } else {
         return this.a.a(com.aspose.cells.b.a.zv.a(((zaam)var1).k(), this.e, true));
      }
   }

   public int c(zagu var1) {
      return com.aspose.cells.b.a.zv.a(((zaam)var1).k(), this.e, true);
   }

   static int a(zagu var0, String var1, zaay var2) {
      switch(var0.b()) {
      case 1:
         if (var2.d.n()) {
            if (((zyv)var0).k()) {
               return 1;
            }

            return 0;
         }

         return 1;
      case 2:
         return com.aspose.cells.b.a.zv.a(((zaam)var0).k(), var1, true);
      case 3:
         if (var2.d.n()) {
            return ((zyy)var0).o();
         }

         return -1;
      case 12:
         return !"".equals(var1) && !var2.d.n() ? -1 : 0;
      default:
         if (var2.p.Q.i.a) {
            com.aspose.cells.a.c.zl.a("Unsupported node type to compare with String: " + var0.b());
         }

         return -1;
      }
   }

   static boolean b(zagu var0, String var1, zaay var2) {
      switch(var0.b()) {
      case 0:
         return false;
      case 1:
         if (var2.d.n()) {
            return !((zyv)var0).k();
         }

         return false;
      case 2:
         return com.aspose.cells.a.c.zx.a(var1, ((zaam)var0).k());
      case 3:
         if (var2.d.n()) {
            return ((zyy)var0).m();
         }

         return false;
      case 4:
      case 5:
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      default:
         if (var2.p.Q.i.a) {
            com.aspose.cells.a.c.zl.a("Unsupported node type to compare with String: " + var0.b());
         }

         return false;
      case 12:
         return "".equals(var1) || var2.d.n();
      }
   }
}
